<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'AddEntry.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	 <script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript">
		function check(){
		if($("#title").val()==""){
		alert("文档名称不能为空");
			return false;
		}
		
		var reg=/^\d{4}-\d{2}-\d{2}$/;
		if($("#createdate").val()==""){
			alert("上传时间不能为空");
			return false;
		}
		if(reg.test($("#createdate").val())==false){
			alert("上传时间格式不正确");
			return false;
		}
		return true;
		}
	
	
	</script>
 </head>
  
  <body>
   <form action="add" method="post" onsubmit="return check()">
   	<input type="text" name="categoryId" id="categoryId" value="${categoryId }"/>
   	<table border="1" width="600" align="center">
   		<tr><td align="center"><h4>增加电子文档</h4></td></tr>
   		<tr>
   		<td>文档名称：<input type="text" name="entry.title" id="title"/></td>
   		</tr>
   		<tr>
   		<td>文档摘要：<textarea name="entry.summary" cols="25" rows="2"></textarea></td>
   		</tr>
   		<tr><td>上传人：<input type="text" name="entry.uploaduser" /></td></tr>
   		<tr><td>上传时间：<input type="text" name="entry.createdate" id="createdate"/>(yy-MM-dd)</td></tr>
   	
   		<tr><td colspan="2" align="center">
   			<input type="submit" name="button" id="button" value="提交"/>&nbsp;&nbsp;&nbsp;
   			<input type="button" name="button" id="button" value="返回" onclick="history.back(-1)"/>
   		</td></tr>
   	
   	
   	</table>
   </form>
  </body>
</html>
